ac4f8b
@@ -38,7 +38,7 @@
public class NOPClosure<E> implements Closure<E>, Serializable {
 
     /**
      * Factory returning the singleton instance.
-     * 
+     *
      * @return the singleton instance
      * @since Commons Collections 3.1
      */
@@ -56,7 +56,7 @@
public class NOPClosure<E> implements Closure<E>, Serializable {
 
     /**
      * Do nothing.
-     * 
+     *
      * @param input  the input object
      */
     public void execute(E input) {
@@ -68,6 +68,12 @@
public class NOPClosure<E> implements Closure<E>, Serializable {
      */
     @Override
     public boolean equals(Object arg0) {
+        if (arg0 == this) {
+            return true;
+        }
+        if (arg0 instanceof NOPClosure == false) {
+            return false;
+        }
         return arg0.hashCode() == this.hashCode();
     }
 
